/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 *
 * @author David
 */
public class ArchitectureMapper {
    
    public static ArchitectureDTO getArchitectureDTO(Architecture architecture){
        ArchitectureDTO dto = new ArchitectureDTO();
        
        dto.setName(architecture.getName());
        dto.setAuthor(architecture.getAuthor());
        
        Map<String, LayerDTO> layers = new LinkedHashMap<String, LayerDTO>();
        for(Layer layer : architecture.getLayerMap().values()){
            layers.put(layer.getName(), LayerMapper.getLayerDTO(layer));
        }
        
        dto.setLayers(layers);
        
        return dto;
    }
}
